const seq = require("../db/seq");
const { DataTypes } = require("sequelize");

const Goods = seq.define(
  "sg_goods",
  {
    classify_id: {
      type: DataTypes.DECIMAL,
      allowNull: false,
      comment: "分类id",
    },
    goods_name: {
      type: DataTypes.STRING,
      allowNull: false,
      comment: "商品名称",
    },

    goods_price: {
      type: DataTypes.DECIMAL,
      allowNull: false,
      comment: "商品价格",
    },
    goods_repertory: {
      type: DataTypes.DECIMAL,
      allowNull: false,
      defaultValue: 1000,
      comment: "剩余库存",
    },
    goods_img: {
      type: DataTypes.STRING,
      allowNull: false,
      comment: "商品图片",
    },
    table_1: {
      type: DataTypes.INTEGER,
      allowNull: false,
      comment: "桌号1",
      defaultValue: 0,
    },
    table_2: {
      type: DataTypes.INTEGER,
      allowNull: false,
      comment: "桌号2",
      defaultValue: 0,
    },
    table_3: {
      type: DataTypes.INTEGER,
      allowNull: false,
      comment: "桌号3",
      defaultValue: 0,
    },
    table_4: {
      type: DataTypes.INTEGER,
      allowNull: false,
      comment: "桌号4",
      defaultValue: 0,
    },
    table_5: {
      type: DataTypes.INTEGER,
      allowNull: false,
      comment: "桌号5",
      defaultValue: 0,
    },
    table_6: {
      type: DataTypes.INTEGER,
      allowNull: false,
      comment: "桌号6",
      defaultValue: 0,
    },
    table_7: {
      type: DataTypes.INTEGER,
      allowNull: false,
      comment: "桌号7",
      defaultValue: 0,
    },
    table_8: {
      type: DataTypes.INTEGER,
      allowNull: false,
      comment: "桌号8",
      defaultValue: 0,
    },
    table_9: {
      type: DataTypes.INTEGER,
      allowNull: false,
      comment: "桌号9",
      defaultValue: 0,
    },
    table_10: {
      type: DataTypes.INTEGER,
      allowNull: false,
      comment: "桌号10",
      defaultValue: 0,
    },
    table_11: {
      type: DataTypes.INTEGER,
      allowNull: false,
      comment: "桌号11",
      defaultValue: 0,
    },
    table_12: {
      type: DataTypes.INTEGER,
      allowNull: false,
      comment: "桌号12",
      defaultValue: 0,
    },
    table_13: {
      type: DataTypes.INTEGER,
      allowNull: false,
      comment: "桌号13",
      defaultValue: 0,
    },
    table_14: {
      type: DataTypes.INTEGER,
      allowNull: false,
      comment: "桌号14",
      defaultValue: 0,
    },
    table_15: {
      type: DataTypes.INTEGER,
      allowNull: false,
      comment: "桌号15",
      defaultValue: 0,
    },
    remark_1: {
      type: DataTypes.STRING,
      allowNull: true,
      comment: "桌号1备注",
    },
    remark_2: {
      type: DataTypes.STRING,
      allowNull: true,
      comment: "桌号2备注",
    },
    remark_3: {
      type: DataTypes.STRING,
      allowNull: true,
      comment: "桌号3备注",
    },
    remark_4: {
      type: DataTypes.STRING,
      allowNull: true,
      comment: "桌号4备注",
    },
    remark_5: {
      type: DataTypes.STRING,
      allowNull: true,
      comment: "桌号5备注",
    },
    remark_6: {
      type: DataTypes.STRING,
      allowNull: true,
      comment: "桌号6备注",
    },
    remark_7: {
      type: DataTypes.STRING,
      allowNull: true,
      comment: "桌号7备注",
    },
    remark_8: {
      type: DataTypes.STRING,
      allowNull: true,
      comment: "桌号8备注",
    },
    remark_9: {
      type: DataTypes.STRING,
      allowNull: true,
      comment: "桌号9备注",
    },
    remark_10: {
      type: DataTypes.STRING,
      allowNull: true,
      comment: "桌号10备注",
    },
    remark_11: {
      type: DataTypes.STRING,
      allowNull: true,
      comment: "桌号11备注",
    },
    remark_12: {
      type: DataTypes.STRING,
      allowNull: true,
      comment: "桌号12备注",
    },
    remark_13: {
      type: DataTypes.STRING,
      allowNull: true,
      comment: "桌号13备注",
    },
    remark_14: {
      type: DataTypes.STRING,
      allowNull: true,
      comment: "桌号14备注",
    },
    remark_15: {
      type: DataTypes.STRING,
      allowNull: true,
      comment: "桌号15备注",
    },
  },
  {
    paranoid: true,
  }
);

// Goods.sync({force:true});
Goods.sync();
module.exports = Goods;
